<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="vue.min.js"></script>
    <style>
        #div1>div{
            min-height: 30px;
            margin: 6px;
            background: aqua;
        }
    </style>
</head>
<body>
<div id="div1">
    <div v-show="ok">ok为true</div>
    <div v-if="ok">ok为true</div>
    <div v-else>ok为false</div>
    <div v-if="str == '1'">str为1</div>
    <div v-else-if="str == '2'">str为2</div>
    <div v-else>str为3</div>
</div>
<script>
    var vm = new Vue({
       el:"#div1",
       data:{
           ok:true,
           str:"2"
       }
    });
</script>
</body>
</html>